﻿/*********************弘石项目三组************************
*  功能描述：绩效管理：部门内考核控制器
*  作者：刘伟康
*  时间：2021-12-20
*  修改人：刘伟康
*  修改时间：2021-12-20
*********************弘石项目三组************************/
using Hong.Business.Business_AssessmentManagement;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WeHongshibApI.Controllers.Controllers_AssessmentManagement
{
    [ApiExplorerSettings(GroupName = "Assessment")]
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class AssDepController : ControllerBase
    {
        #region 构造器注入
        private readonly AssDepBusiness _dal;
        public AssDepController(AssDepBusiness dal)
        {
            _dal = dal;
        }
        #endregion
        #region 部门考核

        #region 显示
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetDepartment()
        {
            var list = _dal.GetDepartment();
            return Ok(list);
        }
        #endregion

        #region 显示人员设置
        /// <summary>
        /// 显示人员设置
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetViewDepErsonnels(int? id)
        {
            var list = _dal.GetViewDepErsonnels(id);
            return Ok(list);
        }
        #endregion

        #region 设置考核状态
        /// <summary>
        /// 设置考核状态
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpPut]
        public IActionResult PutDepartment(int id)
        {
            var obj = _dal.PutDepartment(id);
            return Ok(obj);
        }
        #endregion
        #endregion
    }
}
